package com.mojo.io.stream;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * 字符流
 *
 * @author <a href="mailto:mojo_jj@163.com">Mojo</a>
 */
public class Reader01 {
    public static void main(String[] args) throws IOException {

        //test1();
        String s = "\uD842\uDFB7";
        File file = new File("e:\\a.txt");
        FileReader fileReader = new FileReader(file);
        int read = fileReader.read();
        System.out.println((char) read);
        fileReader.close();
    }

    private static void test1() {
        int i = 18891 + 65536;
//大于65535即mod，此处加了好几个65535，其还是代表18890
//int i = 18890 + 65536 + 65536 + 65536;
//int i = 18890 - 65536 - 65536;
        char c = (char) i;
        System.out.println(c);
//mod针对大于65535的还好使，但是其代表的是这个意思
        System.out.println(i % 65536);
//Integer.valueOf()能得到其代表的unicode值的大小，十进制int表示
        System.out.println(Integer.valueOf(c));
        char d = '䧊';
        int n = (int) d;
    }
}
